import request from '@/utils/request'

export const getList = params => {
  return request({
    url: '/JwtAPI/Company/GetCompanyList',
    method: 'get',
    params: params
  })
}

export const save = data => {
  return request({
    url: '/JwtAPI/Company/SubmitCompany',
    method: 'post',
    data
  })
}

export const getEnterpriseById = (id) => {
  return request({
    url: `/JwtAPI/Company/${id}`,
    method: 'get',
  })
}

export const getBaseEnterprise = () => {
  return request({
    url: `/JwtAPI/Company/GetBaseEnterprise`,
    method: 'get',
  })
}

// 获取全部转运记录List,查询条件：转运申请编号、产废单位、创建日期、状态
export const getAllApplyList = params => {
  return request({
    url: '/SeriesRAPI/HazardousWaste/GetAllTransferApplyList',
    method: 'get',
    params: params
  })
}
// 查看转运申请详情
export const getTransportApplyInfoById = id => {
  return request({
    // todo
    url: `/SeriesRAPI/HazardousWaste/GetTransferApplys?id=${id}`,
    method: 'get',
  })
}
// 得到转运申请单包含的废物库List
export const getApplyWastList = params => {
  return request({
    url: '/SeriesRAPI/HazardousWaste/GetTransferApplyByHwList',
    method: 'get',
    params: params
  })
}

// 查询指定组织ID下的车辆List（不分页）
export const getCarsByOrgId = params => {
  return request({
    url: '/JwtAPI/Vehicle/GetAllVehicleList',
    method: 'get',
    params: params
  })
}

// 得到转运记录List
export const getTransportFormList = params => {
  return request({
    url: '/SeriesRAPI/HazardousWaste/GetHazardousWasteReceiptList',
    method: 'get',
    params: params
  })
}

// 查看转运记录详情
export const getTransportFormInfoById = id => {
  return request({
    url: `/SeriesRAPI/HazardousWaste/GetHazardousWasteReceipts?id=${id}`,
    method: 'get',
  })
}

// 得到转运记录包含的废物实体List
export const getTransportFromWastObjList = params => {
  return request({
    url: '/SeriesRAPI/HazardousWaste/GetHazardousWasteReceiptByHwList',
    method: 'get',
    params: params
  })
}

// 转运派发（改变转运申请状态）
export const destributeTransportApply = data => {
  return request({
    url: '/SeriesRAPI/HazardousWaste/BatchUpdateTransferApply',
    method: 'post',
    data
  })
}

// 获取接受单位为当前用户登录单位的联单List（分页）
export const getTransportFormListByCollectionUnit = params => {
  return request({
    url: '/SeriesRAPI/HazardousWaste/GetAllCompanyHazardousWasteReceiptList',
    method: 'get',
    params: params
  })
}
// 根据当前组织获取废物库List（分页）
export const getWastLibraryList = params => {
  return request({
    url: '/SeriesRAPI/HazardousWaste/GetHazardousWasteList',
    method: 'get',
    params: params
  })
}

// 上传公司图片
export const updateCompanyImg = data => {
  return request({
    url: '/JwtAPI/Company/UpdateCompanyImg',
    method: 'post',
    headers: {
      'Content-Type': 'multipart/form-data;charset=UTF-8'
    },
    data
  })
}

// 根据转运申请ID查询包含的对应废物库所对应的废物实体List（分页）
export const GetHazardousWasteListByTPId = params => {
  return request({
    url: '/SeriesRAPI/HazardousWaste/GetHazardousWasteListByTPId',
    method: 'get',
    params: params
  })
}


// 批量启用或禁用单位

export const DisabledCompany = (data) => {
  return request({
    url: "/JwtAPI/Company/DisabledCompany",
    method: 'post',
    data
  })
}